﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Bordspil.Models
{
    public class GroupRepository : IGroupRepository
    {
        private AppDataContext m_db = new AppDataContext();

        public void AddGroup(Group g)
        {
            m_db.Groups.Add(g);
        }

        public void DeleteMember(int? userId)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<Group> GetAllGroups()
        {
            return m_db.Groups;
        }

        public IEnumerable<GroupMembers> GetAllGroupMembers()
        {
            return m_db.GroupMembers;
        }

        public void Save()
        {
            m_db.SaveChanges();
        }

        public void AddMember(GroupMembers m)
        {
            m_db.GroupMembers.Add(m);
        }

    }
}